<?php
$dom = new DOMDocument("1.0", "utf-8");
$dom = $dom->loadXML('<?xml version="1.0"?>
<!DOCTYPE courses [
<!ELEMENT courses (course+)>
<!ELEMENT course (title)>
<!ELEMENT title (#PCDATA)>
]>
<courses>
<course>
<title>Algebra</title>
</course>
</courses>');

$isValid = $dom->validate();

var_dump($isValid);